//
//  LoloaageIMProtocolPublic.m
//  LAMapBasicDemo
//
//  Created by 罗亮富 on 2018/1/8.
//  Copyright © 2018年 2Bulu. All rights reserved.
//

#import "LoloaageIMProtocolPublic.h"
#import <Foundation/Foundation.h>





NSString *nsstringFromString(String *string)
{
    return [[NSString alloc]initWithBytes:&(string->firstChar) length:string->length encoding:NSUTF8StringEncoding];
}

NSData *stringDataFromNsstring(NSString *objstr)
{
    if(objstr.length > 0)
    {
        NSData *dataStr = [objstr dataUsingEncoding:NSUTF8StringEncoding];
        S16 len = (S16)dataStr.length;
        NSMutableData *data = [NSMutableData dataWithBytes:&len length:sizeof(S16)];
        [data appendData:dataStr];
        return data;
    }
    else
    {
        S16 len = 0;
        return [NSData dataWithBytes:&len length:sizeof(len)];
    }
    
}
